355. Araxis Merge File Comparison Report

Produced by Araxis Merge on 2021-05-13 09:09:15 +0000. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

355.1 Files compared

#LocationFileLast Modified
1/Applications/Ampps/www/Porto 3.2.2/Theme Files/Magento 2.x/Porto Theme/app/design/frontend/Smartwave/porto/web/owl.carouselowl.carousel2.thumbs.js2016-08-28 07:36:40 +0000
2/Applications/Ampps/www/Porto v4.0.0/Theme Files/Magento 2.x/Porto Theme/app/design/frontend/Smartwave/porto/web/owl.carouselowl.carousel2.thumbs.js2016-08-28 07:36:40 +0000

355.2 Comparison summary

DescriptionBetween
Files 1 and 2
Text BlocksLines
Unchanged1434
Changed00
Inserted00
Removed00

355.3 Comparison options

WhitespaceConsecutive whitespace is treated as a single space
Character caseDifferences in character case are significant
Line endingsDifferences in line endings (CR and LF characters) are ignored
CR/LF charactersNot shown in the comparison detail
Active line-pairing rules

355.4 Active regular expressions

No regular expressions were active.

355.5 Comparison detail

1 /** 1 /**
2  * Thumbs Plugin 2  * Thumbs Plugin
3  * @version 2.0.0 3  * @version 2.0.0
4  * @author Gijs Rogé 4  * @author Gijs Rogé
5  * @license The MIT License (MIT) 5  * @license The MIT License (MIT)
6  */ 6  */
7 (function ($, window, document, undefined) { 7 (function ($, window, document, undefined) {
8     'use strict'; 8     'use strict';
9  9 
10     /** 10     /**
11      * Creates the thumbs plugin. 11      * Creates the thumbs plugin.
12      * @class The thumbs Plugin 12      * @class The thumbs Plugin
13      * @param {Owl} carousel - The Owl Carousel 13      * @param {Owl} carousel - The Owl Carousel
14      */ 14      */
15     var Thumbs = function (carousel) { 15     var Thumbs = function (carousel) {
16  16 
17  17 
18         /** 18         /**
19          * Reference to the core. 19          * Reference to the core.
20          * @protected 20          * @protected
21          * @type {Owl} 21          * @type {Owl}
22          */ 22          */
23         this.owl = carousel; 23         this.owl = carousel;
24  24 
25  25 
26         /** 26         /**
27          * All DOM elements for thumbnails 27          * All DOM elements for thumbnails
28          * @protected 28          * @protected
29          * @type {Object} 29          * @type {Object}
30          */ 30          */
31         this._thumbcontent = []; 31         this._thumbcontent = [];
32  32 
33  33 
34         /** 34         /**
35          * Instance identiefier 35          * Instance identiefier
36          * @type {number} 36          * @type {number}
37          * @private 37          * @private
38          */ 38          */
39         this._identifier = 0; 39         this._identifier = 0;
40  40 
41  41 
42         /** 42         /**
43          * Return current item regardless of clones 43          * Return current item regardless of clones
44          * @protected 44          * @protected
45          * @type {Object} 45          * @type {Object}
46          */ 46          */
47         this.owl_currentitem = this.owl.options.startPosition; 47         this.owl_currentitem = this.owl.options.startPosition;
48  48 
49  49 
50         /** 50         /**
51          * The carousel element. 51          * The carousel element.
52          * @type {jQuery} 52          * @type {jQuery}
53          */ 53          */
54         this.$element = this.owl.$element; 54         this.$element = this.owl.$element;
55  55 
56  56 
57         /** 57         /**
58          * All event handlers. 58          * All event handlers.
59          * @protected 59          * @protected
60          * @type {Object} 60          * @type {Object}
61          */ 61          */
62         this._handlers = { 62         this._handlers = {
63             'prepared.owl.carousel': $.proxy(function (e) { 63             'prepared.owl.carousel': $.proxy(function (e) {
64                 if (e.namespace && this.owl.options.thumbs && !this.owl.options.thumbImage && !this.owl.options.thumbsPrerendered && !this.owl.options.thumbImage) { 64                 if (e.namespace && this.owl.options.thumbs && !this.owl.options.thumbImage && !this.owl.options.thumbsPrerendered && !this.owl.options.thumbImage) {
65                     if ($(e.content).find('[data-thumb]').attr('data-thumb') !== undefined) { 65                     if ($(e.content).find('[data-thumb]').attr('data-thumb') !== undefined) {
66                         this._thumbcontent.push($(e.content).find('[data-thumb]').attr('data-thumb')); 66                         this._thumbcontent.push($(e.content).find('[data-thumb]').attr('data-thumb'));
67                     } 67                     }
68                 } else if (e.namespace && this.owl.options.thumbs && this.owl.options.thumbImage) { 68                 } else if (e.namespace && this.owl.options.thumbs && this.owl.options.thumbImage) {
69                     var innerImage = $(e.content).find('img'); 69                     var innerImage = $(e.content).find('img');
70                     this._thumbcontent.push(innerImage); 70                     this._thumbcontent.push(innerImage);
71                 } 71                 }
72             }, this), 72             }, this),
73  73 
74             'initialized.owl.carousel': $.proxy(function (e) { 74             'initialized.owl.carousel': $.proxy(function (e) {
75                 if (e.namespace && this.owl.options.thumbs) { 75                 if (e.namespace && this.owl.options.thumbs) {
76                     this.render(); 76                     this.render();
77                     this.listen(); 77                     this.listen();
78                     this._identifier = this.owl.$element.data('slider-id'); 78                     this._identifier = this.owl.$element.data('slider-id');
79                     this.setActive(); 79                     this.setActive();
80                 } 80                 }
81             }, this), 81             }, this),
82  82 
83             'changed.owl.carousel': $.proxy(function (e) { 83             'changed.owl.carousel': $.proxy(function (e) {
84                 if (e.namespace && e.property.name === 'position' && this.owl.options.thumbs) { 84                 if (e.namespace && e.property.name === 'position' && this.owl.options.thumbs) {
85                     this._identifier = this.owl.$element.data('slider-id'); 85                     this._identifier = this.owl.$element.data('slider-id');
86                     this.setActive(); 86                     this.setActive();
87                 } 87                 }
88             }, this) 88             }, this)
89         }; 89         };
90  90 
91         // set default options 91         // set default options
92         this.owl.options = $.extend({}, Thumbs.Defaults, this.owl.options); 92         this.owl.options = $.extend({}, Thumbs.Defaults, this.owl.options);
93  93 
94         // register the event handlers 94         // register the event handlers
95         this.owl.$element.on(this._handlers); 95         this.owl.$element.on(this._handlers);
96     }; 96     };
97  97 
98  98 
99     /** 99     /**
100      * Default options. 100      * Default options.
101      * @public 101      * @public
102      */ 102      */
103     Thumbs.Defaults = { 103     Thumbs.Defaults = {
104         thumbs: true, 104         thumbs: true,
105         thumbImage: false, 105         thumbImage: false,
106         thumbContainerClass: 'owl-thumbs', 106         thumbContainerClass: 'owl-thumbs',
107         thumbItemClass: 'owl-thumb-item', 107         thumbItemClass: 'owl-thumb-item',
108         moveThumbsInside: false 108         moveThumbsInside: false
109     }; 109     };
110  110 
111  111 
112     /** 112     /**
113      * Listen for thumbnail click 113      * Listen for thumbnail click
114      * @protected 114      * @protected
115      */ 115      */
116     Thumbs.prototype.listen = function () { 116     Thumbs.prototype.listen = function () {
117  117 
118         //set default options 118         //set default options
119         var options = this.owl.options; 119         var options = this.owl.options;
120  120 
121         if (options.thumbsPrerendered) { 121         if (options.thumbsPrerendered) {
122             this._thumbcontent._thumbcontainer = $('.' + options.thumbContainerClass); 122             this._thumbcontent._thumbcontainer = $('.' + options.thumbContainerClass);
123         } 123         }
124  124 
125         //check what thumbitem has been clicked and move slider to that item 125         //check what thumbitem has been clicked and move slider to that item
126         $(this._thumbcontent._thumbcontainer).on('click', this._thumbcontent._thumbcontainer.children(), $.proxy(function (e) { 126         $(this._thumbcontent._thumbcontainer).on('click', this._thumbcontent._thumbcontainer.children(), $.proxy(function (e) {
127  127 
128             // find relative slider 128             // find relative slider
129             this._identifier = $(e.target).closest('.' + options.thumbContainerClass).data('slider-id'); 129             this._identifier = $(e.target).closest('.' + options.thumbContainerClass).data('slider-id');
130  130 
131             // get index of clicked thumbnail 131             // get index of clicked thumbnail
132             var index = $(e.target).parent().is(this._thumbcontent._thumbcontainer) ? $(e.target).index() : $(e.target).closest('.'+options.thumbItemClass).index(); 132             var index = $(e.target).parent().is(this._thumbcontent._thumbcontainer) ? $(e.target).index() : $(e.target).closest('.'+options.thumbItemClass).index();
133  133 
134             if (options.thumbsPrerendered) { 134             if (options.thumbsPrerendered) {
135                 // slide to slide :) 135                 // slide to slide :)
136                 $('[data-slider-id=' + this._identifier + ']').trigger('to.owl.carousel', [index, options.dotsSpeed, true]); 136                 $('[data-slider-id=' + this._identifier + ']').trigger('to.owl.carousel', [index, options.dotsSpeed, true]);
137             } else { 137             } else {
138                 this.owl.to(index, options.dotsSpeed); 138                 this.owl.to(index, options.dotsSpeed);
139             } 139             }
140  140 
141             e.preventDefault(); 141             e.preventDefault();
142         }, this)); 142         }, this));
143     }; 143     };
144  144 
145  145 
146     /** 146     /**
147      * Builds thumbnails 147      * Builds thumbnails
148      * @protected 148      * @protected
149      */ 149      */
150     Thumbs.prototype.render = function () { 150     Thumbs.prototype.render = function () {
151  151 
152         //set default options 152         //set default options
153         var options = this.owl.options; 153         var options = this.owl.options;
154  154 
155         //create thumbcontainer 155         //create thumbcontainer
156         if (!options.thumbsPrerendered) { 156         if (!options.thumbsPrerendered) {
157             this._thumbcontent._thumbcontainer = $('<div>').addClass(options.thumbContainerClass).appendTo(this.$element); 157             this._thumbcontent._thumbcontainer = $('<div>').addClass(options.thumbContainerClass).appendTo(this.$element);
158         } else { 158         } else {
159             this._thumbcontent._thumbcontainer = $('.' + options.thumbContainerClass + ''); 159             this._thumbcontent._thumbcontainer = $('.' + options.thumbContainerClass + '');
160             if(options.moveThumbsInside){ 160             if(options.moveThumbsInside){
161                 this._thumbcontent._thumbcontainer.appendTo(this.$element); 161                 this._thumbcontent._thumbcontainer.appendTo(this.$element);
162             } 162             }
163         } 163         }
164  164 
165         //create thumb items 165         //create thumb items
166         var i; 166         var i;
167         if (!options.thumbImage) { 167         if (!options.thumbImage) {
168             for (i = 0; i < this._thumbcontent.length; ++i) { 168             for (i = 0; i < this._thumbcontent.length; ++i) {
169                 this._thumbcontent._thumbcontainer.append('<button class=' + options.thumbItemClass + '>' + this._thumbcontent[i] + '</button>'); 169                 this._thumbcontent._thumbcontainer.append('<button class=' + options.thumbItemClass + '>' + this._thumbcontent[i] + '</button>');
170             } 170             }
171         } else { 171         } else {
172             for (i = 0; i < this._thumbcontent.length; ++i) { 172             for (i = 0; i < this._thumbcontent.length; ++i) {
173                 this._thumbcontent._thumbcontainer.append('<button class=' + options.thumbItemClass + '><img src="' + this._thumbcontent[i].attr('src') + '" alt="' + this._thumbcontent[i].attr('alt') + '" /></button>'); 173                 this._thumbcontent._thumbcontainer.append('<button class=' + options.thumbItemClass + '><img src="' + this._thumbcontent[i].attr('src') + '" alt="' + this._thumbcontent[i].attr('alt') + '" /></button>');
174             } 174             }
175         } 175         }
176     }; 176     };
177  177 
178  178 
179     /** 179     /**
180      * Updates active class on thumbnails 180      * Updates active class on thumbnails
181      * @protected 181      * @protected
182      */ 182      */
183     Thumbs.prototype.setActive = function () { 183     Thumbs.prototype.setActive = function () {
184  184 
185         // get startslide 185         // get startslide
186         this.owl_currentitem = this.owl._current - (this.owl._clones.length / 2); 186         this.owl_currentitem = this.owl._current - (this.owl._clones.length / 2);
187         if (this.owl_currentitem === this.owl._items.length) { 187         if (this.owl_currentitem === this.owl._items.length) {
188             this.owl_currentitem = 0; 188             this.owl_currentitem = 0;
189         } 189         }
190  190 
191         //set default options 191         //set default options
192         var options = this.owl.options; 192         var options = this.owl.options;
193  193 
194         // set relative thumbnail container 194         // set relative thumbnail container
195         var thumbContainer = options.thumbsPrerendered ? $('.' + options.thumbContainerClass + '[data-slider-id="' + this._identifier + '"]') : this._thumbcontent._thumbcontainer; 195         var thumbContainer = options.thumbsPrerendered ? $('.' + options.thumbContainerClass + '[data-slider-id="' + this._identifier + '"]') : this._thumbcontent._thumbcontainer;
196         thumbContainer.children().filter('.active').removeClass('active'); 196         thumbContainer.children().filter('.active').removeClass('active');
197         thumbContainer.children().eq(this.owl_currentitem).addClass('active'); 197         thumbContainer.children().eq(this.owl_currentitem).addClass('active');
198     }; 198     };
199  199 
200  200 
201     /** 201     /**
202      * Destroys the plugin. 202      * Destroys the plugin.
203      * @public 203      * @public
204      */ 204      */
205     Thumbs.prototype.destroy = function () { 205     Thumbs.prototype.destroy = function () {
206         var handler, property; 206         var handler, property;
207         for (handler in this._handlers) { 207         for (handler in this._handlers) {
208             this.owl.$element.off(handler, this._handlers[handler]); 208             this.owl.$element.off(handler, this._handlers[handler]);
209         } 209         }
210         for (property in Object.getOwnPropertyNames(this)) { 210         for (property in Object.getOwnPropertyNames(this)) {
211             typeof this[property] !== 'function' && (this[property] = null); 211             typeof this[property] !== 'function' && (this[property] = null);
212         } 212         }
213     }; 213     };
214  214 
215     $.fn.owlCarousel.Constructor.Plugins.Thumbs = Thumbs; 215     $.fn.owlCarousel.Constructor.Plugins.Thumbs = Thumbs;
216  216 
217 })(window.Zepto || window.jQuery, window, document); 217 })(window.Zepto || window.jQuery, window, document);